#include <iostream>
#include <fstream>
#include <jansson.h>

using namespace std;

void read_json(){

	ifstream in("d:/art/server/urls.json");

	json_t* arr;
	json_error_t err;
	string str;

	if (in.is_open()) {
		cout<<"file opened!!"<<endl;
		while (!in.eof()) {
			string s;
			in>>s;
			str+=s;
		}
	}

	//cout<<str<<endl;
	arr = json_loads(str.c_str(), 0, &err);

	if (arr) {
		
		if (json_is_array(arr)) {
			cout<<"arr size:"<<json_array_size(arr)<<endl;
		}
		return;
	}
	cout<<err.text<<endl;

}

int main() {
	cout<<"hello"<<endl;

	read_json();


	return 0;
}
